package com.luojiang.validator.domain;

import com.luojiang.validator.group.DraftGroup;
import com.luojiang.validator.group.SaveGroup;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.groups.Default;

/**
 * @ClassName Tenant
 * @Description
 * @Author luojiang
 * @Date 2021/1/26 17:26
 */
public class Tenant {

    @NotNull(message = "id不能为空", groups = {SaveGroup.class})
    private Long id;

    @Length(max = 5, message = "名称不能超过{max}个字符", groups = {DraftGroup.class, SaveGroup.class})
    private String name;

    @Length(max = 5, message = "简介不能超过{max}个字符", groups = {SaveGroup.class})
    private String intro;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIntro() {
        return intro;
    }

    public void setIntro(String intro) {
        this.intro = intro;
    }

    @Override
    public String toString() {
        return "Tenant{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", intro='" + intro + '\'' +
                '}';
    }
}
